﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CostAccounting.Edit.aspx.cs"
    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=2011"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/datepicker.css" />
    <script type='text/javascript' src="assets/js/jquery.ui.datepicker.js"></script>
    <script src="assets/jquery/jquery.printElement.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#txtFrom").datepicker({ dateFormat: "dd-mm-yy" });
            $("#txtTo").datepicker({ dateFormat: "dd-mm-yy" });
            $('input').keydown(function(e) {
                if (e.keyCode == 13) {
                    $('#btnSave').click();
                }
            });
            jQuery(".addnew-buyprice").blur(function () {  
                    $(".addnew-buypriceinvoice").get(0).value=jQuery(".addnew-buyprice").val();                    
                });
            jQuery(".addnew-sellprice").blur(function () {                      
                    $(".addnew-sellpriceinvoice").get(0).value=jQuery(".addnew-sellprice").val();
                });    
            $("#Print").click(function() {
                 var vid = getUrlVars()['id'];
                  window.open("./CostAccounting.Edit.Print.aspx?id=" + vid,"mywindow","menubar=0,status=0,directories=0,resizable=1,scrollbars=1,width=720,height=500");  
        });
         $("#DebitNote").click(function() {
                 var vid = getUrlVars()['id'];
                  window.open("./DebitNote.aspx?id=" + vid,"mywindow","menubar=0,status=0,directories=0,resizable=1,scrollbars=1,width=800,height=800");  
        });        
        });
        jQuery("document").ready(function(){              
            var vid = getUrlVars()['id'];
        
       
           jQuery("#FileNumber").blur(function () {               
            if(vid==undefined)
                {
                    $("#HBLNo").get(0).value = "00"+jQuery("#FileNumber").val();                      
                     if($("#AccountingName").val()=="")
                          $("#AccountingName").get(0).value = "<% Response.Write(Session["logined_user"].ToString());%>";   
                          jQuery.ajax({
                               type: "POST",
                               url: "AjaxFile/GetCostNo.ashx?src=acc",
                               success: function(msg){                                                                                             
                               var arrSource=msg.split(",");                                       
                               $('#FileNumber').autocomplete(arrSource);  
                                        var costnumber = jQuery("#FileNumber").val();    
                                        if(costnumber.length>0)
                                        {                       
                                              jQuery.ajax({
                                                   type: "POST",
                                                   url: "AjaxFile/GetCostAccountingInfo.ashx?rd="+Math.random()+"&costno="+costnumber,
                                                   success: function(json){    
                                                  if(json.length>0)
                                                  {
                                                   var parsedJSON = eval('('+json+')');
                                                     $("#POL").get(0).value = parsedJSON.POL;
                                                     $("#POD").get(0).value = parsedJSON.POD;
                                                     $("#Agent").get(0).value = parsedJSON.Agent;
                                                     $("#Customer").get(0).value = parsedJSON.Customer;
                                                     $("#Liabilities").get(0).value = parsedJSON.Liabilities;
                                                     $("#TB_Customer").get(0).value = parsedJSON.TB_Customer;
                                                     $("#SaleName").get(0).value = parsedJSON.SaleName;
                                                     $("#SaleOfProvince").get(0).value = parsedJSON.SaleOfProvince;
                                                     $("#ETD").get(0).value = parsedJSON.ETD;     
                                                     $("#OfferPriceID").get(0).value = parsedJSON.OfferPriceID;
                                                     $("#CarrSale").get(0).value = parsedJSON.CarrSale;                                                    
                                                     $("#CustPic").get(0).value = parsedJSON.CustPic;                                                    
                                                   }
                                                  }                                
                                              });             
                                          }
                              }                               
                          }); 
                        }                                                                       
                     }).blur();   
         });
    </script>
    <style type="text/css">
        #action_button
        {
            float: right;
            width: 350px;
            margin: 9px;
        }
        #action_button input[type=button]
        {
            margin-left: 5px;
        }
        .thheader
        {
            font-weight: bold;
            vertical-align: middle;
            text-align: center;
            font-size: 11px;
            border: 1px solid #ccc !important;
            line-height: 12px !important;
        }
        table.adminlist td
        {
            padding: 7px !important;
        }
        table.adminlist thead th
        {
            padding: 7px !important;
        }
        .tdboder
        {
            border: none !important;
        }
        .tdboder p
        {
            padding: 1px !important;
            width: 40px;
            border: 1px solid #ccc !important;
            border-bottom: 1px solid #ccc !important;
        }
        input[type=text], input[type=password], textarea, select
        {
            border: none;
            line-height: 22px;
            width: 100% !important;
        }
        input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus
        {
            border-color: #4488cc;
            border-style: solid;
            border-width: 1px;
            margin: 0;
            background-color: #FCFFC5 !important;
        }
        .row
        {
            border-bottom: 1px solid #E9E9E9;
        }
        #backgroundPopup
        {
            display: none;
            position: fixed;
            _position: absolute; /* hack for internet explorer 6*/
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            background: #000000;
            border: 1px solid #cecece;
            z-index: 1;
        }
        #close
        {
            width: 61px;
            height: 20px;
            display: block;
            position: absolute;
            top: 340px;
            left: 360px;
            overflow: hidden;
        }
        #btnCancel
        {
            color: #FFFFFF;
            cursor: pointer;
        }
        .contact-top
        {
            text-align: right;
        }
        .view10row
        {
            float: left;
            height: 475px;
            top: 0px;
            vertical-align: top;
            display: inline;
            overflow-y: scroll;
            overflow-x: no;
            width: 100%;
        }
        .bottom td
        {
            font-weight: bold;
            text-align: right;
        }
    </style>
    <script type="text/javascript">

        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(caId, cadId) {
            if (confirm('Bạn có thực sự muốn xóa ?')) {
                var vnpage = getUrlVars()['page_number'];
                var strHref = "";
                if (vnpage)
                    strHref = "CostAccounting.Edit.aspx?action=delete&ID=" + caId + "&cadid=" + cadId + "&page_number=" + vnpage;
                else
                    strHref = "CostAccounting.Edit.aspx?action=delete&ID=" + caId + "&cadid=" + cadId;
                window.location.href = strHref;
            }
        }
        function doBack() {

            var vnpage = getUrlVars()['page_number'];
            var strHref = "";
            if (vnpage)
                strHref = "CostAccounting.aspx?page_number=" + vnpage;
            else
                strHref = "CostAccounting.aspx";
            window.location.href = strHref;
        }
    
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                COSTING SHEET:
                <%=Province %>
            </h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmEdit" runat="server">
                <!--Cost Accounting Part 1-->
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                        General Infomation
                        <asp:Label ID="lblError" CssClass="error" Text="" runat="server"></asp:Label>
                    </h3>
                    <div id="action_button">
                        <asp:Button class="button" ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
                        <input id="Button1" type="button" class="button" value="&nbsp;&nbsp;Back&nbsp;&nbsp;"
                            onclick="doBack();" />
                        <input type="button" id="Print" class="button" runat="server" value="In danh sách này" />
                        <input type="button" id="DebitNote" class="button" runat="server" value="Debit Note" />
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                    <tr style="background: #ECECEC;">
                        <td align="center" class="thheader">
                            Số file
                        </td>
                        <td align="center" class="thheader" colspan="2">
                            POL
                        </td>
                        <td align="center" class="thheader">
                            POD
                        </td>
                        <td align="center" class="thheader">
                            ATD
                        </td>
                        <td align="center" class="thheader">
                            ETA
                        </td>
                        <td align="center" class="thheader">
                            Nhà cung cấp
                        </td>
                        <td align="center" class="thheader">
                            Carr Sale
                        </td>
                        <td align="center" class="thheader" colspan="2">
                            Khách hàng
                        </td>
                        <td align="center" class="thheader">
                            Cust Pic
                        </td>
                        <td align="center" class="thheader">
                            M/BL NO
                        </td>
                        <td align="center" class="thheader" colspan="2">
                            H/BL NO
                        </td>
                        <td align="center" class="thheader">
                            Freight
                        </td>
                        <td align="center" class="thheader">
                            Công nợ
                        </td>
                    </tr>
                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                        <td>
                            <asp:TextBox ID="FileNumber" runat="server" Text="" Width="70px" TabIndex="2"></asp:TextBox>
                            <asp:HiddenField ID="OfferPriceID" runat="server" Value="" />
                        </td>
                        <td colspan="2">
                            <asp:TextBox ID="POL" runat="server" Text="" Style="width: 100px !important" TabIndex="2"
                                TextMode="MultiLine" Rows="3"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="POD" runat="server" Text="" Style="width: 100px !important" TabIndex="2"
                                TextMode="MultiLine" Rows="3" Wrap="true"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="ETD" runat="server" Text="" Width="70px" TabIndex="2" onkeyup="dtval(this,event)"
                                MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="ETA" runat="server" Text="" Width="100px" TabIndex="2" onkeyup="dtval(this,event)"
                                MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="Agent" runat="server" Text="" Width="70px" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="CarrSale" runat="server" Text="" Width="70px" TabIndex="2"></asp:TextBox>
                        </td>
                        <td colspan="2">
                            <asp:TextBox ID="Customer" runat="server" Text="" Style="width: 150px !important"
                                TabIndex="2" TextMode="MultiLine" Rows="3" Wrap="true"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="CustPic" runat="server" Text="" Width="70px" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="MBLNo" runat="server" Text="" Width="50px" TabIndex="2"></asp:TextBox>
                        </td>
                        <td  colspan="2">
                            <asp:TextBox ID="HBLNo" runat="server" Text="" Style="width: 100px !important" TabIndex="2"
                                TextMode="MultiLine" Wrap="true"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="Freight" runat="server" Text="" Width="20" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="Liabilities" runat="server" Text="" Width="20" TabIndex="2"></asp:TextBox>
                        </td>
                    </tr>
                    <tr style="background: #ECECEC;">
                        <td align="center" class="thheader">
                            Lãi suất(%)
                        </td>
                        <td align="center" class="thheader">
                            % TB K.hàng
                        </td>
                        <td align="center" class="thheader">
                            % TB Nhà CC
                        </td>
                        <td align="center" class="thheader">
                            Tên Sale
                        </td>
                        <td align="center" class="thheader">
                            Văn phòng
                        </td>
                        <td align="center" class="thheader">
                            Người lập
                        </td>
                        <td align="center" class="thheader">
                            Ngày lập
                        </td>
                        <td align="center" class="thheader">
                            Số hóa đơn BR
                        </td>
                        <td align="center" class="thheader">
                            Ngày hóa đơn BR
                        </td>
                        <td align="center" class="thheader">
                            Tỷ giá mua vào
                        </td>
                        <td align="center" class="thheader">
                            Tỉ giá bán ra
                        </td>
                        <td align="center" class="thheader">
                            Ngày trả
                        </td>
                        <td class="thheader">
                            Số hóa đơn MV
                        </td>
                        <td class="thheader">
                            Ngày hóa đơn MV
                        </td>
                        <td colspan="2" class="thheader">
                            Ghi chú
                        </td>
                    </tr>
                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                        <td>
                            <asp:TextBox ID="Interest" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Customer" runat="server" Text="" Style="width: 50px !important"
                                TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="TB_Agent" runat="server" Text="50" Style="width: 50px !important"
                                TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="SaleName" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="SaleOfProvince" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="AccountingName" runat="server" Text="" TabIndex="2" CssClass="AccountingName"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="AccountingDate" runat="server" Text="" TabIndex="2" onkeyup="dtval(this,event)"
                                MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="InvoicesNo" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="InvoicesDate" runat="server" Text="" TabIndex="2" onkeyup="dtval(this,event)"
                                MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="RateBuy" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="RateSell" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Date_Expiration" runat="server" Text="" TabIndex="2"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="InvoicesNoBuy" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="InvoicesDateBuy" runat="server" Text="" TabIndex="2" onkeyup="dtval(this,event)"
                                MaxLength="10" onblur="setFocus(this);"></asp:TextBox>
                        </td>
                        <td colspan="2">
                            <asp:TextBox ID="txtNote" runat="server" Text="" TabIndex="2"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                        Details Infomation
                    </h3>
                </div>
                <div class="clear">
                </div>
                <fieldset>
                    <asp:Repeater ID="rptData" runat="server" OnItemDataBound="rptData_ItemDataBound">
                        <ItemTemplate>
                            <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                <td align="center">
                                    <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    <asp:HiddenField ID="ID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
                                    </asp:HiddenField>
                                </td>
                                <td align="center">
                                    <asp:TextBox ID="Description" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "Description")%>'
                                        CssClass="clsPol"></asp:TextBox>
                                </td>
                                <td align="center">
                                    <asp:TextBox ID="Units" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "Units")%>'
                                        CssClass="clsPod"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="Amount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Amount")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="TypeOfCurrency" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TypeOfCurrency")%>'
                                        Style="display: none; width: 50px !important;" CssClass="TypeOfCurrency"></asp:TextBox>
                                    <asp:DropDownList ID="ddTypeOfCurrency" runat="server" CssClass="ddTypeOfCurrency">
                                        <asp:ListItem Text="USD" Value="USD"></asp:ListItem>
                                        <asp:ListItem Text="VND" Value="VND"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="BuyPrice" runat="server" CssClass='<%#Eval("ID").ToString()=="-1"?"addnew-buyprice":"" %>'
                                        Text='<%# DataBinder.Eval(Container.DataItem, "BuyPrice")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "BuyTotal")%>
                                </td>
                                <td>
                                    <asp:TextBox ID="BuyPriceInvoice" runat="server" CssClass='<%#Eval("ID").ToString()=="-1"?"addnew-buypriceinvoice":"" %>'
                                        Text='<%# DataBinder.Eval(Container.DataItem, "BuyPriceInvoice")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "BuyTotalInvoice")%>
                                </td>
                                <td>
                                    <asp:TextBox ID="SellPrice" runat="server" CssClass='<%#Eval("ID").ToString()=="-1"?"addnew-sellprice":"" %>'
                                        Text='<%# DataBinder.Eval(Container.DataItem, "SellPrice")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "SellTotal")%>
                                </td>
                                <td>
                                    <asp:TextBox ID="SellPriceInvoice" runat="server" CssClass='<%#Eval("ID").ToString()=="-1"?"addnew-sellpriceinvoice":"" %>'
                                        Text='<%# DataBinder.Eval(Container.DataItem, "SellPriceInvoice")%>'></asp:TextBox>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "SellTotalInvoice")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "SellTotalInvoiceVND")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "ComAgent")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "ComCustomer")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "TaxAgent")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "TaxCustomer")%>
                                </td>
                                <td>
                                    <%# DataBinder.Eval(Container.DataItem, "Profit")%>
                                </td>
                                <td>
                                    <asp:TextBox ID="Note" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Note")%>'></asp:TextBox>
                                </td>
                                <td align="center" class="tbody_action">
                                    <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <HeaderTemplate>
                            <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                                <thead>
                                    <tr>
                                        <th align="center" class="thheader" rowspan="2">
                                            Stt
                                        </th>
                                        <th align="center" class="thheader" colspan="4">
                                            Chi tiết
                                        </th>
                                        <th align="center" class="thheader" colspan="2">
                                            Mua vào
                                        </th>
                                        <th align="center" class="thheader" colspan="2">
                                            Hóa đơn mua vào
                                        </th>
                                        <th align="center" class="thheader" colspan="2">
                                            Bán ra
                                        </th>
                                        <th align="center" class="thheader" colspan="3">
                                            Hóa đơn bán ra
                                        </th>
                                        <th align="center" class="thheader" colspan="2">
                                            Com
                                        </th>
                                        <th align="center" class="thheader" colspan="2">
                                            Thuế thu lại
                                        </th>
                                        <th align="center" class="thheader" rowspan="2" style="width: 50px;">
                                            Lãi suất
                                        </th>
                                        <th align="center" class="thheader" rowspan="2" style="width: 100px;">
                                            Ghi chú
                                        </th>
                                        <th align="center" class="thheader" rowspan="2" style="width: 40px;" id="thead_action">
                                            Action
                                        </th>
                                    </tr>
                                    <tr>
                                        <th align="center" class="thheader" width="50px">
                                            Mô tả
                                        </th>
                                        <th align="center" class="thheader" width="50px">
                                            Đơn vị tính
                                        </th>
                                        <th align="center" class="thheader" width="30px">
                                            Số lượng
                                        </th>
                                        <th align="center" class="thheader" width="65px">
                                            Loại tiền
                                        </th>
                                        <th align="center" class="thheader">
                                            Đơn giá
                                        </th>
                                        <th align="center" class="thheader">
                                            Thành tiền
                                        </th>
                                        <th align="center" class="thheader">
                                            Đơn giá
                                        </th>
                                        <th align="center" class="thheader">
                                            Thành tiền
                                        </th>
                                        <th align="center" class="thheader">
                                            Đơn giá
                                        </th>
                                        <th align="center" class="thheader">
                                            Thành tiền
                                        </th>
                                        <th align="center" class="thheader">
                                            Đơn giá
                                        </th>
                                        <th align="center" class="thheader">
                                            Thành tiền
                                        </th>
                                        <th align="center" class="thheader">
                                            Thành tiền VND
                                        </th>
                                        <th align="center" class="thheader" style="width: 40px;">
                                            Nhà CC
                                        </th>
                                        <th align="center" class="thheader" style="width: 40px;">
                                            Khách hàng
                                        </th>
                                        <th align="center" class="thheader">
                                            Nhà CC
                                        </th>
                                        <th align="center" class="thheader">
                                            Khách hàng
                                        </th>
                                    </tr>
                                </thead>
                        </HeaderTemplate>
                        <FooterTemplate>
                            <tr class="bottom">
                                <td colspan="5">
                                    Tổng tiền USD
                                </td>
                                <td colspan="2">
                                    <%=BuyTotal_USD.ToString("#,#.##")%>
                                </td>
                                <td colspan="2">
                                    <%=BuyTotalInvoice_USD.ToString("#,#.##")%>
                                </td>
                                <td colspan="2">
                                    <%=SellTotal_USD.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=SellTotalInvoice_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                </td>
                                <td>
                                    <%=ComAgent_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=ComCustomer_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxAgent_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxCustomer_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=Profit_USD.ToString("#,#.##") %>
                                </td>
                                <td>
                                </td>
                                <td class="tdbottom">
                                </td>
                            </tr>
                            <tr class="bottom">
                                <td colspan="5">
                                    Tổng tiền VND
                                </td>
                                <td colspan="2">
                                    <%=BuyTotal_VND.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=BuyTotalInvoice_VND.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=SellTotal_VND.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=SellTotalInvoice_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                </td>
                                <td>
                                    <%=ComAgent_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=ComCustomer_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxAgent_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxCustomer_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=Profit_VND.ToString("#,#.##") %>
                                </td>
                                <td>
                                </td>
                                <td class="tdbottom">
                                </td>
                            </tr>
                            <tr class="bottom">
                                <td colspan="5">
                                    Quy đổi VND
                                </td>
                                <td colspan="2">
                                    <%=BuyTotal_ALL.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=BuyTotalInvoice_ALL.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=SellTotal_ALL.ToString("#,#.##") %>
                                </td>
                                <td colspan="2">
                                    <%=SellTotalInvoice_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=SellTotalInvoice_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=ComAgent_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=ComCustomer_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxAgent_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=TaxCustomer_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                    <%=Profit_ALL.ToString("#,#.##") %>
                                </td>
                                <td>
                                </td>
                                <td class="tdbottom">
                                </td>
                            </tr>
                            </TABLE>
                        </FooterTemplate>
                    </asp:Repeater>
                </fieldset>
                <div class="clear">
                </div>
                <div id="footer">
                    <%=strPager%>
                </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
